#pragma once
#include "Renderer.h"
#include "PhysicsSystem.h"
#include "GameEntity.h"

#include <vector>

#define RENDER_HZ	60
#define PHYSICS_HZ	120

#define PHYSICS_TIMESTEP (1000.0f / (float)PHYSICS_HZ)

class GameClass	{
public:
	GameClass();
	virtual ~GameClass();

	virtual void CleanUp();

	void UpdateCore(float msec, bool physics = true);
	virtual void UpdateGame(float msec) = 0;

	bool		Init(){ return init; }

	//static GameClass& GetGameClass() { return *instance;}

	Camera* GetGameCamera()	{return gameCamera;}

	void resetCounters() {	physicsCounter = 0;
							renderCounter = 0; 
		};

	void AddGameEnity(GameEntity* ge){ allEntities.push_back(ge); }

	void	SetExit(bool e){ exit = e; }
	bool	Exit(){ return exit; }
	float	GetElapsedTime() { return elapsedTime; }

protected:
	float renderCounter;
	float physicsCounter;

	vector<GameEntity*> allEntities;

	Camera* gameCamera;
	//static GameClass* instance;

	bool physicsEnabled;
	bool init;
	bool exit;

	float elapsedTime;
};

